package com.wwwarehouse.contract.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

/**
 * Created by clannad.shao on 2017/11/6.
 */

public class ExpressDetailBean implements Parcelable{


    /**
     * expressNo : yd111111115
     * trackList : [{"trackStatus":70717,"trackStatusName":"测试内容kon1","trackDesc":"【杭州中转部】正在扫描","trackTime":"今天 14:29:03"},{"trackStatus":70717,"trackStatusName":"测试内容kon1","trackDesc":"由【义乌北苑营业部】发往【杭州中转部】","trackTime":"昨天 06:29:03"},{"trackStatus":70717,"trackStatusName":"测试内容kon1","trackDesc":"厂家发货","trackTime":"2017-11-01 15:29:03"}]
     * trackStatusCode : 1065
     */

    private String expressName;
    private String expressNo;
    private int trackStatusCode;
    private String sendAddress;
    private String receiveAddress;
    private ArrayList<TrackListBean> trackList;

    public String getExpressName() {
        return expressName;
    }

    public void setExpressName(String expressName) {
        this.expressName = expressName;
    }

    public String getExpressNo() {
        return expressNo;
    }

    public void setExpressNo(String expressNo) {
        this.expressNo = expressNo;
    }

    public int getTrackStatusCode() {
        return trackStatusCode;
    }

    public void setTrackStatusCode(int trackStatusCode) {
        this.trackStatusCode = trackStatusCode;
    }

    public ArrayList<TrackListBean> getTrackList() {
        return trackList;
    }

    public void setTrackList(ArrayList<TrackListBean> trackList) {
        this.trackList = trackList;
    }

    public String getSendAddress() {
        return sendAddress;
    }

    public void setSendAddress(String sendAddress) {
        this.sendAddress = sendAddress;
    }

    public String getReceiveAddress() {
        return receiveAddress;
    }

    public void setReceiveAddress(String receiveAddress) {
        this.receiveAddress = receiveAddress;
    }

    public static class TrackListBean implements Parcelable{
        /**
         * trackStatus : 70717
         * trackStatusName : 测试内容kon1
         * trackDesc : 【杭州中转部】正在扫描
         * trackTime : 今天 14:29:03
         */


        private int trackStatus;
        private String trackStatusName;
        private String trackDesc;
        private String trackTime;

        public int getTrackStatus() {
            return trackStatus;
        }

        public void setTrackStatus(int trackStatus) {
            this.trackStatus = trackStatus;
        }

        public String getTrackStatusName() {
            return trackStatusName;
        }

        public void setTrackStatusName(String trackStatusName) {
            this.trackStatusName = trackStatusName;
        }

        public String getTrackDesc() {
            return trackDesc;
        }

        public void setTrackDesc(String trackDesc) {
            this.trackDesc = trackDesc;
        }

        public String getTrackTime() {
            return trackTime;
        }

        public void setTrackTime(String trackTime) {
            this.trackTime = trackTime;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeInt(this.trackStatus);
            dest.writeString(this.trackStatusName);
            dest.writeString(this.trackDesc);
            dest.writeString(this.trackTime);
        }

        public TrackListBean() {
        }

        protected TrackListBean(Parcel in) {
            this.trackStatus = in.readInt();
            this.trackStatusName = in.readString();
            this.trackDesc = in.readString();
            this.trackTime = in.readString();
        }

        public static final Creator<TrackListBean> CREATOR = new Creator<TrackListBean>() {
            @Override
            public TrackListBean createFromParcel(Parcel source) {
                return new TrackListBean(source);
            }

            @Override
            public TrackListBean[] newArray(int size) {
                return new TrackListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.expressName);
        dest.writeString(this.expressNo);
        dest.writeInt(this.trackStatusCode);
        dest.writeString(this.sendAddress);
        dest.writeString(this.receiveAddress);
        dest.writeTypedList(this.trackList);
    }

    public ExpressDetailBean() {
    }

    protected ExpressDetailBean(Parcel in) {
        this.expressName = in.readString();
        this.expressNo = in.readString();
        this.trackStatusCode = in.readInt();
        this.sendAddress = in.readString();
        this.receiveAddress = in.readString();
        this.trackList = in.createTypedArrayList(TrackListBean.CREATOR);
    }

    public static final Creator<ExpressDetailBean> CREATOR = new Creator<ExpressDetailBean>() {
        @Override
        public ExpressDetailBean createFromParcel(Parcel source) {
            return new ExpressDetailBean(source);
        }

        @Override
        public ExpressDetailBean[] newArray(int size) {
            return new ExpressDetailBean[size];
        }
    };
}
